/*
#include <stack>
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <sstream>
using namespace std;
void ipAddr(vector<string>&result,vector<string>&ip,string str){
	if(str.length()<1)
		return;
	if(ip.size()==3){
		if(str.length()>1&&str[0]=='0')
			return;
		int tmp=atoi(str.c_str());
		if(tmp>=0&&tmp<=255){
			string s=ip[0]+"."+ip[1]+"."+ip[2]+"."+str;
			result.push_back(s);
		}
	}else{
		int len=str.length();
		for(int i=0;i<3&&i+1<len;i++){
			string s=str.substr(0,i+1);
			if(i>0&&s[0]=='0')
				break;
			int tmp=atoi(s.c_str());
			if(tmp>=0&&tmp<=255){
				ip.push_back(s);
				ipAddr(result,ip,str.substr(i+1,str.length()-i-1));
				ip.pop_back();
			}
		}
	}
}
vector<string> restoreIpAddresses(string str) {
	vector<string>result,ip;
	ipAddr(result,ip,str);
	return result;
}
int main(){
	int a[]={1,2,3,4,5};
	vector<int> nums1(a,a+sizeof(a)/sizeof(int));
	
	restoreIpAddresses("1010010");
	cout<<endl;
	system("pause");
}
*/